/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {
    sequelize: {
      dialect: 'mysql',
      host: '127.0.0.1',
      port: 3306,
      database: 'casback',
      username: 'z',
      password: '1234',
    },
    cluster: {
      listen: {
        port: 7003,
      },
    },
    cors: {
      origin: 'http://localhost:3000',
      allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
      credentials: true,
    },
    view: {
      defaultViewEngine: 'nunjucks',
    },
    proxy: true,
    maxIpsCount: 1,
  };

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1582117960775_1372';

  // add your middleware config here
  config.middleware = [ 'errorHandler', 'authorize' ];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
